define(function(require, exports, module) {

  var Backbone = require('backbone');
  var $ = require('jquery');
  var _ = require('underscore');
  var jsonview = require('jsonview');

  var zrender = require('zrender');
  var color = require('zrender/tool/color')
  var Trochoid = require('zrender/graphic/shape/Trochoid')

  var Rose = require('zrender/graphic/shape/Rose')

  function main() {
    var $app = $('<div id="app">').height(window.env.h);
    $('#main').html($app);
    app($app)
  }

  function app($app) {
    var zr = zrender.init($app[0]);

    var trochoid = new Trochoid({
      shape: {
        cx: 450,
        cy: 200,
        r:50,
        r0:35,
        d:30,
      },
      style: {
        location: 'out',
        stroke: 'blue',
        lineWidth : 2,
        text :'外旋轮曲线',
        textPosition :'inside'
      },
      hoverable : true,   // default true
      draggable : true
    })

    zr.add(trochoid);


    var rose = new Rose({
      shape: {
        x : 300,
        y : 100,
        r : [35],
        k : 7,
        n : 4
      },

      style: {
        stroke: '#fcc',
        lineWidth : 2,
        textPosition :'inside',
        text: 'rose'
      },

      draggable: true
    });

    zr.add(rose)

  }

  return main;
})
